package ystest

import (
	"context"
	"github.com/gogf/gf/v2/container/gmap"
	"github.com/gogf/gf/v2/os/gctx"
)

var __instance *gmap.StrAnyMap

func instance() *gmap.StrAnyMap {
	if __instance == nil {
		__instance = gmap.NewStrAnyMap(true)
	}
	return __instance
}

func TestCtxIns(name ...string) context.Context {
	key := "default"
	if len(name) > 0 {
		key = name[0]
	}
	return instance().GetOrSet(key, gctx.New()).(context.Context)
}
